package pt.moltos.chatmessaging;

import java.util.Scanner;
import pt.moltos.rabbit.Receive;
import pt.moltos.rabbit.Send;

public class App 
{
    private static Scanner in = new Scanner(System.in);
    private static Boolean cont = true;
    public static void main( String[] args )
    {
//        Recv task;
//        task = new Recv();
//        task.start();
//        
        Chatwindow toSend = new Chatwindow();
        toSend.setVisible(true);
        new Receive(toSend).start();
        
        Send send = new Send();
        while(true){
            String message = in.nextLine();
            if(message.isEmpty()){
                break;
            }
            
            send.sendMessage(message);
            //SendMessage.sendMessage(message);
            
        }
        
        System.exit(0);
    }
}
